/**
 * @author [siwi]
 * @email [siwi@siwi.me]
 * @create date 2018-03-10 04:07:56
 * @modify date 2018-03-10 04:07:56
 * @desc [description]
*/
const path = require('path')
const fs = require('fs')
class File {
    constructor () {

    }
    /**
     * 创建文件
     * @param {*} file_path 
     * @param {*} options 
     */
    async create (file_path, options = false) {
        return options ? fs.createWriteStream(file_path, options):fs.createWriteStream(file_path)
    }
    /**
     * 读取文件
     * @param {*} file_path 
     * @param {*} options 
     */
    async read (file_path, options = false) {
        return options ? fs.createReadStream(file_path, options):fs.createReadStream(file_path)
    }
}
module.exports = File